package com.newblog.factory;

import java.sql.Connection;

import com.newblog.dao.OptionDAO;
import com.newblog.dao.OptionDAOMysql;

public class OptionDaoFactory {
	private static OptionDaoFactory factory = null;
	private Connection conn = null;
	private OptionDAO optionDAO;
	public OptionDaoFactory(){
		this.conn = DB.getConn();
		this.optionDAO = new OptionDAOMysql(this.conn);
	}
	
	public static synchronized OptionDaoFactory getInstance(){
		if(factory  == null){
			factory  = new OptionDaoFactory();
		}
		return factory;
	}
    public OptionDAO createOptionDAO(){
    	return optionDAO;
    }
}
